package com.xiaoyuan.minicore.core;

import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.List;

import com.xiaoyuan.minicore.core.ConfigHelper;
import com.xiaoyuan.minicore.util.ClassUtil;


/**
 * @Auther: xiaoyuan
 * @Date: 2020/4/28
 * @Description:
 */
public class ClassHelper {

    private static final String packageName = ConfigHelper.getString("package.name");

    public static List<Class<?>> getClassListBySuper(Class<?> superClass) {
        return ClassUtil.getClassListBySuper(packageName, superClass);
    }

    public static List<Class<?>> getClassListByAnnotation(Class<? extends Annotation> annotationClass) {
        return ClassUtil.getClassListByAnnotation(packageName, annotationClass);
    }

    public static List<Class<?>> getClassListByInterface(Class<?> interfaceClass) {
        return ClassUtil.getClassListByInterface(packageName, interfaceClass);
    }

    public static Collection<? extends Class<?>> getClassListByPackage(String pkg) {
        return ClassUtil.getClassListByPkg(pkg);
    }
}
